package com.coupon.util;

import lombok.Data;

/**
 * 2 * @Author: xy
 * 3 * @Date: 2021/10/25 下午 8:13:41
 */
@Data
public class Response_Data {
    private int code;
    private String msg;
    private Object data;

    public Response_Data(int code, String msg, Object data) {
        this.code = code;
        this.msg = msg;
        this.data = data;
    }

    public static Response_Data success(Object data) {
        return new Response_Data(Response_status.SUCCESS.getCode(), Response_status.SUCCESS.getMessage(), data);
    }

    public static Response_Data success() {
        return new Response_Data(Response_status.SUCCESS.getCode(), Response_status.SUCCESS.getMessage(), null);
    }

    public static Response_Data fail() {
        return new Response_Data(Response_status.FAIL.getCode(), Response_status.FAIL.getMessage(), null);

    }

    public static Response_Data fail(Object data) {
        return new Response_Data(Response_status.FAIL.getCode(), Response_status.FAIL.getMessage(), data);
    }

}
